/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Sequential;

import java.io.IOException;

/**
 *
 * @author zwirek
 */
public class ExampleImplementation implements ElementHandler{
    private double max = Double.MIN_VALUE;
    private int cnt=0;
    @Override
    public boolean onEndElement(Node n) {
        if(n.getName().equals("LatitudeMeasure")){
            double d = Double.parseDouble(n.getText());
            if(d>max)
                max=d;
            cnt++;
        }
        return false;
    }

    @Override
    public void onEndParsing() {
        System.out.println(cnt+" Max: "+max);
    }

    @Override
    public void onStartElement(Node n) {
    }




}
